﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;

namespace CjcPhotoPrint
{
	public abstract class Transformation : DependencyObject, INotifyPropertyChanged
	{
		public string Name { get; private set; }

		public Transformation( string name )
		{
			Name = name;
		}

		public virtual TransformationContext ParentOverride( TransformationContext parent )
		{
			return parent;
		}

		public static Size RelativeSize( double aspectRatio )
		{
			return ( aspectRatio > 1 )
				? new Size( 1, 1 / aspectRatio )
				: new Size( aspectRatio, 1 );
		}

		public virtual Drawing GetDrawing( Drawing parent )
		{
			return parent;
		}

		#region INotifyPropertyChanged Members

		public event PropertyChangedEventHandler PropertyChanged;

		protected void OnPropertyChanged( string propertyName )
		{
			if ( PropertyChanged != null ) PropertyChanged( this, new PropertyChangedEventArgs( propertyName ) );
		}

		#endregion
	}
}